package com.example.死信队列;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeadProducer {

    @Autowired
    RabbitTemplate rabbitTemplate;
    @GetMapping("/deadSend")
    public void send(){
        rabbitTemplate.convertAndSend(DeadLetterConfig.MSG_LETTER_EXCHANGE,DeadLetterConfig.MSG_LETTER_QUEUE,"这条消息将过期进入死信队列");
    }
}
